<?php
use  yii\helpers\Url;
use  yii\helpers\Html;
?>
<header class="fixed-top">
  <div class="header-top-wrap">
    <div class="container header-top">
      <div class="logo-wrap">
        <img class="logo-img" src="/assets/logo.png" alt="" />
        <!-- <div class="name-wrap">
          <div class="cn-name">陕西能源投资股份有限公司</div>
          <div class="en-name">SHANXI ENERGY INVESTMENT CO LTD</div>
        </div> -->
      </div>
      <div class="href-wrap">
        <a class="text-dark" href="">加入收藏</a>
        <a class="text-dark" href="http://113.200.57.61/GTHINKING/N_FRAMEWORK/FrameWork.aspx">办公OA</a>
        <a class="text-dark" href="mailto:001@sngfgs.com">企业邮箱</a>
      </div>
    </div>
  </div>
  <nav class="navbar navbar-expand-lg navbar-dark">
    <div class="container-lg">
      <div class="min-logo logo-wrap">
        <img class="logo-img" src="/assets/logo.png" alt="" />
        <!-- <div class="name-wrap">
          <div class="cn-name">陕西能源投资股份有限公司</div>
          <div class="en-name">SHANXI ENERGY INVESTMENT CO LTD</div>
        </div> -->
      </div>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#indexNavbars" aria-controls="indexNavbars" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="indexNavbars">
        <ul class="navbar-nav mr-auto">
        <?php if ($data['menu']) {?>
          <?php foreach ($data['menu'] as $one => $first): ?>
              <?php if ($first['children']) {?>
                <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" id="<?= Html::encode($one)?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="<?=Url::toRoute([$first['path']?:'site/menu', 'menu_id'=>$first['id']])?>"><?= Html::encode($first['label'])?></a>
                <div class="dropdown-menu" aria-labelledby="<?= Html::encode($one)?>">
                <?php foreach ($first['children'] as $two => $second): ?>
                  <a class="dropdown-item a-menu" data-id="<?= Html::encode($second['id'])?>" href="<?=Url::toRoute([$first['path']?:'site/menu', 'menu_id'=>$second['id']])?>"><?= Html::encode($second['label'])?></a>
                <?php endforeach ?>
              <?php }else {?>
                <li class="nav-item">
                <a class="nav-link" href="<?=Url::toRoute([$first['path']?:'site/menu', 'menu_id'=>$first['id']])?>"><?= Html::encode($first['label'])?></a>
              <?php }?>
            </li>
          <?php endforeach ?>
        <?php }?>
        </ul>
      </div>
    </div>
  </nav>
</header>